<?php use_helper('Date') ?>
<?php use_stylesheet('profile.css')?>

<div id="profile">
  <h1>
    <?php if ($sf_user->getGuardUser()->id == $trader->getUserId()) : ?>
      <?php echo __('Your profile') ?>
    <?php else : ?>
      <?php echo __('%username% profile', array('%username%' => ucfirst($trader->getSfGuardUser()->getUsername()))) ?>
    <?php endif ?>
  </h1>
  <table>
    <tbody>
      <tr>
        <th><?php echo __('Trader profile', null, 'form') ?></th>
        <td><?php if ($trader_character) echo $trader_character->getName() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Country', null, 'form') ?></th>
        <td><?php echo $trader->getCountry() ?></td>
      </tr>
      <tr>
        <th><?php echo __('City code', null, 'form') ?></th>
        <td><?php echo $trader->getCityCode() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Sex', null, 'form') ?></th>
        <td>
          <?php if ($trader->getSex() == 'H'): ?>
            Homme
          <?php elseif  ($trader->getSex() == 'F'): ?>
            Femme
          <?php endif ?>

        </td>
      </tr>
      <tr>
        <th><?php echo __('Picture', null, 'form') ?></th>
        <td><img height="50" width="50" src="<?php echo '/uploads/traders/'.$trader->getPicture() ?>" /></td>
      </tr>
      <tr>
        <th><?php echo __('Phone', null, 'form') ?></th>
        <td><?php echo $trader->getPhone() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Mobile', null, 'form') ?></th>
        <td><?php echo $trader->getMobilePhone() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Skype', null, 'form') ?></th>
        <td><?php echo $trader->getSkypeAddress() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Personnal description', null, 'form') ?></th>
        <td><?php echo $trader->getPersonnalDescription() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Job', null, 'form') ?></th>
        <td><?php echo $trader->getJob() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Asset', null, 'form') ?></th>
        <td><?php echo $trader->getAsset() ?></td>
      </tr>
      <tr>
        <th><?php echo __('Started in', null, 'form') ?></th>
        <td><?php echo format_date($trader->getStarted(), 'yyyy') ?></td>
      </tr>
      <tr>
        <th><?php echo __('Weekly hour', null, 'form') ?></th>
        <td>
          <?php echo $trader->getWeeklyHour() ?>
          <?php if ($trader->getWeeklyHour() != NULL): ?>
            h
          <?php endif ?>
        </td>
      </tr>
    </tbody>
  </table>

  <hr />

  <?php if ($sf_user->getGuardUser()->id == $trader->getUserId()) : ?>
    <?php echo link_to(__('Edit profile'), 'trader_edit', $sf_user->getGuardUser()); ?>
  <?php endif ?>
</div>